<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "../header.html" encoding="UTF-8"/>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <i-col span="4">
                <i-input v-model="q.title" @on-enter="query" placeholder="活动类别主题"/>
            </i-col>
            <i-button @click="query">查询</i-button>
            <!--#if($shiro.hasPermission("topiccategory:save"))-->
            <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
           <!-- #end
            #if($shiro.hasPermission("topiccategory:update"))-->
            <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
            <!--#end
            #if($shiro.hasPermission("topiccategory:delete"))-->
            <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
           <!-- #end-->
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="topicBook" :rules="ruleValidate" :label-width="120">
            <Form-item label="活动标题" prop="topicId" style="width: 368px;">
                <i-select v-model="topicBook.topicId" filterable label-in-value>
                    <i-option v-for="topic in topics" :value="topic.id"
                              :key="topic.id">{{topic.title}}
                    </i-option>
                </i-select>
            </Form-item>

            <Form-item label="图书" prop="bookId" style="width: 368px;">
                <i-select v-model="topicBook.bookId" filterable label-in-value>
                    <i-option v-for="book in books" :value="book.id"
                              :key="book.id">{{book.name}}
                    </i-option>
                </i-select>
            </Form-item>

            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/static/vue/js/shop/topicBook.js"></script>
</body>
</html>